package com.example.front.controller;

import com.example.common.dto.JsonResult;
import com.example.common.dto.ListDto;
import com.example.common.dto.Pagination;
import com.example.front.entity.MessageLogging;
import com.example.front.serivce.MaintenanceService;
import com.example.front.serivce.MessageLoggingService;
import com.example.interceptor.UserContext;
import com.example.passport.dto.LoggingDto;
import com.example.passport.entity.Logging;
import com.example.passport.entity.User;
import com.example.passport.service.LoggingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@Api(tags = "日志管理")
@RestController
@CrossOrigin
@RequestMapping("/front/messageLogging")
public class MessageLoggingController {
    @Resource
    public MessageLoggingService messageLoggingService;

    @ApiOperation("获取消息日志")
    @GetMapping("/list")
    public JsonResult<ListDto<LoggingDto>> list(MessageLogging condition, Pagination pagination) {
//        User user = UserContext.getUser();
//        condition.setTenantId(user.getTenantId());
        return new JsonResult(messageLoggingService.listMessageLogging(condition,pagination));
    }

}
